{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _regeneratorRuntime from \"@babel/runtime/helpers/esm/regeneratorRuntime\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/esm/asyncToGenerator\";\nimport RawAsyncValidator from 'async-validator';\nimport * as React from 'react';\nimport warning from \"rc-util/es/warning\";\nimport { defaultValidateMessages } from './messages';\nimport { setValues } from './valueUtil';\n// Remove incorrect original ts define\nvar AsyncValidator = RawAsyncValidator;\n/**\n * Replace with template.\n *   `I'm ${name}` + { name: 'bamboo' } = I'm bamboo\n */\nfunction replaceMessage(template, kv) {\n  return template.replace(/\\$\\{\\w+\\}/g, function (str) {\n    var key = str.slice(2, -1);\n    return kv[key];\n  });\n}\nvar CODE_LOGIC_ERROR = 'CODE_LOGIC_ERROR';\nfunction validateRule(_x, _x2, _x3, _x4, _x5) {\n  return _validateRule.apply(this, arguments);\n}\n/**\n * We use `async-validator` to validate the value.\n * But only check one value in a time to avoid namePath validate issue.\n */\nfunction _validateRule() {\n  _validateRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(name, value, rule, options, messageVariables) {\n    var cloneRule, originValidator, subRuleField, validator, messages, result, subResults, kv, fillVariableResult;\n    return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n      while (1) {\n        switch (_context2.prev = _context2.next) {\n          case 0:\n            cloneRule = _objectSpread({}, rule); // Bug of `async-validator`\n            // https://github.com/react-component/field-form/issues/316\n            // https://github.com/react-component/field-form/issues/313\n            delete cloneRule.ruleIndex;\n            if (cloneRule.validator) {\n              originValidator = cloneRule.validator;\n              cloneRule.validator = function () {\n                try {\n                  return originValidator.apply(void 0, arguments);\n                } catch (error) {\n                  console.error(error);\n                  return Promise.reject(CODE_LOGIC_ERROR);\n                }\n              };\n            }\n            // We should special handle array validate\n            subRuleField = null;\n            if (cloneRule && cloneRule.type === 'array' && cloneRule.defaultField) {\n              subRuleField = cloneRule.defaultField;\n              delete cloneRule.defaultField;\n            }\n            validator = new AsyncValidator(_defineProperty({}, name, [cloneRule]));\n            messages = setValues({}, defaultValidateMessages, options.validateMessages);\n            validator.messages(messages);\n            result = [];\n            _context2.prev = 9;\n            _context2.next = 12;\n            return Promise.resolve(validator.validate(_defineProperty({}, name, value), _objectSpread({}, options)));\n          case 12:\n            _context2.next = 17;\n            break;\n          case 14:\n            _context2.prev = 14;\n            _context2.t0 = _context2[\"catch\"](9);\n            if (_context2.t0.errors) {\n              result = _context2.t0.errors.map(function (_ref4, index) {\n                var message = _ref4.message;\n                var mergedMessage = message === CODE_LOGIC_ERROR ? messages.default : message;\n                return /*#__PURE__*/React.isValidElement(mergedMessage) ? /*#__PURE__*/\n                // Wrap ReactNode with `key`\n                React.cloneElement(mergedMessage, {\n                  key: \"error_\".concat(index)\n                }) : mergedMessage;\n              });\n            }\n          case 17:\n            if (!(!result.length && subRuleField)) {\n              _context2.next = 22;\n              break;\n            }\n            _context2.next = 20;\n            return Promise.all(value.map(function (subValue, i) {\n              return validateRule(\"\".concat(name, \".\").concat(i), subValue, subRuleField, options, messageVariables);\n            }));\n          case 20:\n            subResults = _context2.sent;\n            return _context2.abrupt(\"return\", subResults.reduce(function (prev, errors) {\n              return [].concat(_toConsumableArray(prev), _toConsumableArray(errors));\n            }, []));\n          case 22:\n            // Replace message with variables\n            kv = _objectSpread(_objectSpread({}, rule), {}, {\n              name: name,\n              enum: (rule.enum || []).join(', ')\n            }, messageVariables);\n            fillVariableResult = result.map(function (error) {\n              if (typeof error === 'string') {\n                return replaceMessage(error, kv);\n              }\n              return error;\n            });\n            return _context2.abrupt(\"return\", fillVariableResult);\n          case 25:\n          case \"end\":\n            return _context2.stop();\n        }\n      }\n    }, _callee2, null, [[9, 14]]);\n  }));\n  return _validateRule.apply(this, arguments);\n}\nexport function validateRules(namePath, value, rules, options, validateFirst, messageVariables) {\n  var name = namePath.join('.');\n  // Fill rule with context\n  var filledRules = rules.map(function (currentRule, ruleIndex) {\n    var originValidatorFunc = currentRule.validator;\n    var cloneRule = _objectSpread(_objectSpread({}, currentRule), {}, {\n      ruleIndex: ruleIndex\n    });\n    // Replace validator if needed\n    if (originValidatorFunc) {\n      cloneRule.validator = function (rule, val, callback) {\n        var hasPromise = false;\n        // Wrap callback only accept when promise not provided\n        var wrappedCallback = function wrappedCallback() {\n          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n            args[_key] = arguments[_key];\n          }\n          // Wait a tick to make sure return type is a promise\n          Promise.resolve().then(function () {\n            warning(!hasPromise, 'Your validator function has already return a promise. `callback` will be ignored.');\n            if (!hasPromise) {\n              callback.apply(void 0, args);\n            }\n          });\n        };\n        // Get promise\n        var promise = originValidatorFunc(rule, val, wrappedCallback);\n        hasPromise = promise && typeof promise.then === 'function' && typeof promise.catch === 'function';\n        /**\n         * 1. Use promise as the first priority.\n         * 2. If promise not exist, use callback with warning instead\n         */\n        warning(hasPromise, '`callback` is deprecated. Please return a promise instead.');\n        if (hasPromise) {\n          promise.then(function () {\n            callback();\n          }).catch(function (err) {\n            callback(err || ' ');\n          });\n        }\n      };\n    }\n    return cloneRule;\n  }).sort(function (_ref, _ref2) {\n    var w1 = _ref.warningOnly,\n      i1 = _ref.ruleIndex;\n    var w2 = _ref2.warningOnly,\n      i2 = _ref2.ruleIndex;\n    if (!!w1 === !!w2) {\n      // Let keep origin order\n      return i1 - i2;\n    }\n    if (w1) {\n      return 1;\n    }\n    return -1;\n  });\n  // Do validate rules\n  var summaryPromise;\n  if (validateFirst === true) {\n    // >>>>> Validate by serialization\n    summaryPromise = new Promise( /*#__PURE__*/function () {\n      var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {\n        var i, rule, errors;\n        return _regeneratorRuntime().wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                i = 0;\n              case 1:\n                if (!(i < filledRules.length)) {\n                  _context.next = 12;\n                  break;\n                }\n                rule = filledRules[i];\n                _context.next = 5;\n                return validateRule(name, value, rule, options, messageVariables);\n              case 5:\n                errors = _context.sent;\n                if (!errors.length) {\n                  _context.next = 9;\n                  break;\n                }\n                reject([{\n                  errors: errors,\n                  rule: rule\n                }]);\n                return _context.abrupt(\"return\");\n              case 9:\n                i += 1;\n                _context.next = 1;\n                break;\n              case 12:\n                /* eslint-enable */\n                resolve([]);\n              case 13:\n              case \"end\":\n                return _context.stop();\n            }\n          }\n        }, _callee);\n      }));\n      return function (_x6, _x7) {\n        return _ref3.apply(this, arguments);\n      };\n    }());\n  } else {\n    // >>>>> Validate by parallel\n    var rulePromises = filledRules.map(function (rule) {\n      return validateRule(name, value, rule, options, messageVariables).then(function (errors) {\n        return {\n          errors: errors,\n          rule: rule\n        };\n      });\n    });\n    summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then(function (errors) {\n      // Always change to rejection for Field to catch\n      return Promise.reject(errors);\n    });\n  }\n  // Internal catch error to avoid console error log.\n  summaryPromise.catch(function (e) {\n    return e;\n  });\n  return summaryPromise;\n}\nfunction finishOnAllFailed(_x8) {\n  return _finishOnAllFailed.apply(this, arguments);\n}\nfunction _finishOnAllFailed() {\n  _finishOnAllFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(rulePromises) {\n    return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n      while (1) {\n        switch (_context3.prev = _context3.next) {\n          case 0:\n            return _context3.abrupt(\"return\", Promise.all(rulePromises).then(function (errorsList) {\n              var _ref5;\n              var errors = (_ref5 = []).concat.apply(_ref5, _toConsumableArray(errorsList));\n              return errors;\n            }));\n          case 1:\n          case \"end\":\n            return _context3.stop();\n        }\n      }\n    }, _callee3);\n  }));\n  return _finishOnAllFailed.apply(this, arguments);\n}\nfunction finishOnFirstFailed(_x9) {\n  return _finishOnFirstFailed.apply(this, arguments);\n}\nfunction _finishOnFirstFailed() {\n  _finishOnFirstFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(rulePromises) {\n    var count;\n    return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n      while (1) {\n        switch (_context4.prev = _context4.next) {\n          case 0:\n            count = 0;\n            return _context4.abrupt(\"return\", new Promise(function (resolve) {\n              rulePromises.forEach(function (promise) {\n                promise.then(function (ruleError) {\n                  if (ruleError.errors.length) {\n                    resolve([ruleError]);\n                  }\n                  count += 1;\n                  if (count === rulePromises.length) {\n                    resolve([]);\n                  }\n                });\n              });\n            }));\n          case 2:\n          case \"end\":\n            return _context4.stop();\n        }\n      }\n    }, _callee4);\n  }));\n  return _finishOnFirstFailed.apply(this, arguments);\n}","map":{"version":3,"names":["_toConsumableArray","_defineProperty","_regeneratorRuntime","_objectSpread","_asyncToGenerator","RawAsyncValidator","React","warning","defaultValidateMessages","setValues","AsyncValidator","replaceMessage","template","kv","replace","str","key","slice","CODE_LOGIC_ERROR","validateRule","_x","_x2","_x3","_x4","_x5","_validateRule","apply","arguments","mark","_callee2","name","value","rule","options","messageVariables","cloneRule","originValidator","subRuleField","validator","messages","result","subResults","fillVariableResult","wrap","_callee2$","_context2","prev","next","ruleIndex","error","console","Promise","reject","type","defaultField","validateMessages","resolve","validate","t0","errors","map","_ref4","index","message","mergedMessage","default","isValidElement","cloneElement","concat","length","all","subValue","i","sent","abrupt","reduce","enum","join","stop","validateRules","namePath","rules","validateFirst","filledRules","currentRule","originValidatorFunc","val","callback","hasPromise","wrappedCallback","_len","args","Array","_key","then","promise","catch","err","sort","_ref","_ref2","w1","warningOnly","i1","w2","i2","summaryPromise","_ref3","_callee","_callee$","_context","_x6","_x7","rulePromises","finishOnFirstFailed","finishOnAllFailed","e","_x8","_finishOnAllFailed","_callee3","_callee3$","_context3","errorsList","_ref5","_x9","_finishOnFirstFailed","_callee4","count","_callee4$","_context4","forEach","ruleError"],"sources":["/data/messenger.client/node_modules/rc-field-form/es/utils/validateUtil.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _regeneratorRuntime from \"@babel/runtime/helpers/esm/regeneratorRuntime\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/esm/asyncToGenerator\";\nimport RawAsyncValidator from 'async-validator';\nimport * as React from 'react';\nimport warning from \"rc-util/es/warning\";\nimport { defaultValidateMessages } from './messages';\nimport { setValues } from './valueUtil';\n// Remove incorrect original ts define\nvar AsyncValidator = RawAsyncValidator;\n/**\n * Replace with template.\n *   `I'm ${name}` + { name: 'bamboo' } = I'm bamboo\n */\nfunction replaceMessage(template, kv) {\n  return template.replace(/\\$\\{\\w+\\}/g, function (str) {\n    var key = str.slice(2, -1);\n    return kv[key];\n  });\n}\nvar CODE_LOGIC_ERROR = 'CODE_LOGIC_ERROR';\nfunction validateRule(_x, _x2, _x3, _x4, _x5) {\n  return _validateRule.apply(this, arguments);\n}\n/**\n * We use `async-validator` to validate the value.\n * But only check one value in a time to avoid namePath validate issue.\n */\nfunction _validateRule() {\n  _validateRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(name, value, rule, options, messageVariables) {\n    var cloneRule, originValidator, subRuleField, validator, messages, result, subResults, kv, fillVariableResult;\n    return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n      while (1) {\n        switch (_context2.prev = _context2.next) {\n          case 0:\n            cloneRule = _objectSpread({}, rule); // Bug of `async-validator`\n            // https://github.com/react-component/field-form/issues/316\n            // https://github.com/react-component/field-form/issues/313\n            delete cloneRule.ruleIndex;\n            if (cloneRule.validator) {\n              originValidator = cloneRule.validator;\n              cloneRule.validator = function () {\n                try {\n                  return originValidator.apply(void 0, arguments);\n                } catch (error) {\n                  console.error(error);\n                  return Promise.reject(CODE_LOGIC_ERROR);\n                }\n              };\n            }\n            // We should special handle array validate\n            subRuleField = null;\n            if (cloneRule && cloneRule.type === 'array' && cloneRule.defaultField) {\n              subRuleField = cloneRule.defaultField;\n              delete cloneRule.defaultField;\n            }\n            validator = new AsyncValidator(_defineProperty({}, name, [cloneRule]));\n            messages = setValues({}, defaultValidateMessages, options.validateMessages);\n            validator.messages(messages);\n            result = [];\n            _context2.prev = 9;\n            _context2.next = 12;\n            return Promise.resolve(validator.validate(_defineProperty({}, name, value), _objectSpread({}, options)));\n          case 12:\n            _context2.next = 17;\n            break;\n          case 14:\n            _context2.prev = 14;\n            _context2.t0 = _context2[\"catch\"](9);\n            if (_context2.t0.errors) {\n              result = _context2.t0.errors.map(function (_ref4, index) {\n                var message = _ref4.message;\n                var mergedMessage = message === CODE_LOGIC_ERROR ? messages.default : message;\n                return /*#__PURE__*/React.isValidElement(mergedMessage) ?\n                /*#__PURE__*/\n                // Wrap ReactNode with `key`\n                React.cloneElement(mergedMessage, {\n                  key: \"error_\".concat(index)\n                }) : mergedMessage;\n              });\n            }\n          case 17:\n            if (!(!result.length && subRuleField)) {\n              _context2.next = 22;\n              break;\n            }\n            _context2.next = 20;\n            return Promise.all(value.map(function (subValue, i) {\n              return validateRule(\"\".concat(name, \".\").concat(i), subValue, subRuleField, options, messageVariables);\n            }));\n          case 20:\n            subResults = _context2.sent;\n            return _context2.abrupt(\"return\", subResults.reduce(function (prev, errors) {\n              return [].concat(_toConsumableArray(prev), _toConsumableArray(errors));\n            }, []));\n          case 22:\n            // Replace message with variables\n            kv = _objectSpread(_objectSpread({}, rule), {}, {\n              name: name,\n              enum: (rule.enum || []).join(', ')\n            }, messageVariables);\n            fillVariableResult = result.map(function (error) {\n              if (typeof error === 'string') {\n                return replaceMessage(error, kv);\n              }\n              return error;\n            });\n            return _context2.abrupt(\"return\", fillVariableResult);\n          case 25:\n          case \"end\":\n            return _context2.stop();\n        }\n      }\n    }, _callee2, null, [[9, 14]]);\n  }));\n  return _validateRule.apply(this, arguments);\n}\nexport function validateRules(namePath, value, rules, options, validateFirst, messageVariables) {\n  var name = namePath.join('.');\n  // Fill rule with context\n  var filledRules = rules.map(function (currentRule, ruleIndex) {\n    var originValidatorFunc = currentRule.validator;\n    var cloneRule = _objectSpread(_objectSpread({}, currentRule), {}, {\n      ruleIndex: ruleIndex\n    });\n    // Replace validator if needed\n    if (originValidatorFunc) {\n      cloneRule.validator = function (rule, val, callback) {\n        var hasPromise = false;\n        // Wrap callback only accept when promise not provided\n        var wrappedCallback = function wrappedCallback() {\n          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n            args[_key] = arguments[_key];\n          }\n          // Wait a tick to make sure return type is a promise\n          Promise.resolve().then(function () {\n            warning(!hasPromise, 'Your validator function has already return a promise. `callback` will be ignored.');\n            if (!hasPromise) {\n              callback.apply(void 0, args);\n            }\n          });\n        };\n        // Get promise\n        var promise = originValidatorFunc(rule, val, wrappedCallback);\n        hasPromise = promise && typeof promise.then === 'function' && typeof promise.catch === 'function';\n        /**\n         * 1. Use promise as the first priority.\n         * 2. If promise not exist, use callback with warning instead\n         */\n        warning(hasPromise, '`callback` is deprecated. Please return a promise instead.');\n        if (hasPromise) {\n          promise.then(function () {\n            callback();\n          }).catch(function (err) {\n            callback(err || ' ');\n          });\n        }\n      };\n    }\n    return cloneRule;\n  }).sort(function (_ref, _ref2) {\n    var w1 = _ref.warningOnly,\n      i1 = _ref.ruleIndex;\n    var w2 = _ref2.warningOnly,\n      i2 = _ref2.ruleIndex;\n    if (!!w1 === !!w2) {\n      // Let keep origin order\n      return i1 - i2;\n    }\n    if (w1) {\n      return 1;\n    }\n    return -1;\n  });\n  // Do validate rules\n  var summaryPromise;\n  if (validateFirst === true) {\n    // >>>>> Validate by serialization\n    summaryPromise = new Promise( /*#__PURE__*/function () {\n      var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {\n        var i, rule, errors;\n        return _regeneratorRuntime().wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                i = 0;\n              case 1:\n                if (!(i < filledRules.length)) {\n                  _context.next = 12;\n                  break;\n                }\n                rule = filledRules[i];\n                _context.next = 5;\n                return validateRule(name, value, rule, options, messageVariables);\n              case 5:\n                errors = _context.sent;\n                if (!errors.length) {\n                  _context.next = 9;\n                  break;\n                }\n                reject([{\n                  errors: errors,\n                  rule: rule\n                }]);\n                return _context.abrupt(\"return\");\n              case 9:\n                i += 1;\n                _context.next = 1;\n                break;\n              case 12:\n                /* eslint-enable */\n                resolve([]);\n              case 13:\n              case \"end\":\n                return _context.stop();\n            }\n          }\n        }, _callee);\n      }));\n      return function (_x6, _x7) {\n        return _ref3.apply(this, arguments);\n      };\n    }());\n  } else {\n    // >>>>> Validate by parallel\n    var rulePromises = filledRules.map(function (rule) {\n      return validateRule(name, value, rule, options, messageVariables).then(function (errors) {\n        return {\n          errors: errors,\n          rule: rule\n        };\n      });\n    });\n    summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then(function (errors) {\n      // Always change to rejection for Field to catch\n      return Promise.reject(errors);\n    });\n  }\n  // Internal catch error to avoid console error log.\n  summaryPromise.catch(function (e) {\n    return e;\n  });\n  return summaryPromise;\n}\nfunction finishOnAllFailed(_x8) {\n  return _finishOnAllFailed.apply(this, arguments);\n}\nfunction _finishOnAllFailed() {\n  _finishOnAllFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(rulePromises) {\n    return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n      while (1) {\n        switch (_context3.prev = _context3.next) {\n          case 0:\n            return _context3.abrupt(\"return\", Promise.all(rulePromises).then(function (errorsList) {\n              var _ref5;\n              var errors = (_ref5 = []).concat.apply(_ref5, _toConsumableArray(errorsList));\n              return errors;\n            }));\n          case 1:\n          case \"end\":\n            return _context3.stop();\n        }\n      }\n    }, _callee3);\n  }));\n  return _finishOnAllFailed.apply(this, arguments);\n}\nfunction finishOnFirstFailed(_x9) {\n  return _finishOnFirstFailed.apply(this, arguments);\n}\nfunction _finishOnFirstFailed() {\n  _finishOnFirstFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(rulePromises) {\n    var count;\n    return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n      while (1) {\n        switch (_context4.prev = _context4.next) {\n          case 0:\n            count = 0;\n            return _context4.abrupt(\"return\", new Promise(function (resolve) {\n              rulePromises.forEach(function (promise) {\n                promise.then(function (ruleError) {\n                  if (ruleError.errors.length) {\n                    resolve([ruleError]);\n                  }\n                  count += 1;\n                  if (count === rulePromises.length) {\n                    resolve([]);\n                  }\n                });\n              });\n            }));\n          case 2:\n          case \"end\":\n            return _context4.stop();\n        }\n      }\n    }, _callee4);\n  }));\n  return _finishOnFirstFailed.apply(this, arguments);\n}"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,mBAAmB,MAAM,+CAA+C;AAC/E,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,iBAAiB,MAAM,6CAA6C;AAC3E,OAAOC,iBAAiB,MAAM,iBAAiB;AAC/C,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,uBAAuB,QAAQ,YAAY;AACpD,SAASC,SAAS,QAAQ,aAAa;AACvC;AACA,IAAIC,cAAc,GAAGL,iBAAiB;AACtC;AACA;AACA;AACA;AACA,SAASM,cAAc,CAACC,QAAQ,EAAEC,EAAE,EAAE;EACpC,OAAOD,QAAQ,CAACE,OAAO,CAAC,YAAY,EAAE,UAAUC,GAAG,EAAE;IACnD,IAAIC,GAAG,GAAGD,GAAG,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,OAAOJ,EAAE,CAACG,GAAG,CAAC;EAChB,CAAC,CAAC;AAC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